package com.cf.swagger.service.impl;

import com.cf.swagger.dao.UserDao;
import com.cf.swagger.dto.UserDto;
import com.cf.swagger.entity.User;
import com.cf.swagger.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: YangF
 * @Date: 2020-12-24 15:50
 * @description:
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User queryUserByLogin(UserDto userDto) {
        return userDao.selectByPrimaryKey(userDto);
    }

    @Override
    public List<User> queryAll() {
        return userDao.queryAll();
    }

    @Override
    public void queryInsert(User user) {
        userDao.queryInsert(user);
    }

    @Override
    public User findUserByName(String username) {
        return userDao.findUserByName(username);
    }

    @Override
    public User selectUserById(Integer id) {
        return userDao.selectByKey(id);
    }

    @Override
    public User findUserById(Integer id) {
        return userDao.findUserById(id);
    }

    @Override
    public int putUser(User user) {
        return userDao.putUser(user);
    }

    @Override
    public void deleteUser(Integer id) {
        userDao.deleteByPrimaryKey(id);
    }


}
